package com.yang.autoConfig;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("auto-config.xml");
        Persion persion = (Persion) context.getBean("persion");
        System.out.println(persion);
        //自动配置
        Persion persion1 = (Persion) context.getBean("persionByName");
        System.out.println(persion1);

        Persion persion2 = (Persion) context.getBean("persionByType");
        System.out.println(persion2);
    }
}
